package com.rabbiter.market.service.sale_management.sale_records;

import com.rabbiter.market.domain.sale.sale_records.SaleRecords;
import com.rabbiter.market.qo.sale_records.QuerySaleRecords;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.rabbiter.market.service.sale_management.order.OrderVo;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

public interface ISaleRecordsService extends IService<SaleRecords> {

    List<Map<String, Object>> getOptionSaleRecordsGoods();

    /**
     * 提交订单
     * @param saleRecords
     * @param token
     * @param response
     */
    void saveSaleRecords(SaleRecords saleRecords, String token, HttpServletResponse response) throws Exception;

    /**
     * 管理端订单查询
     * @param qo
     * @return
     */
    Page<SaleRecords> queryPageByQoSaleRecords(QuerySaleRecords qo);

    /**
     * 用户端订单查询
     * @param qo
     * @param token
     * @return
     */
    List<OrderVo> queryPageByQoSaleRecords(QuerySaleRecords qo, String token);

    void delSaleRecords(String cn);

    /**
     * 更新订单状态
     * @param saleRecords
     */
    void updateSaleRecords(SaleRecords saleRecords);

    /**
     *
     * @param outTradeNo
     * @return
     */
    SaleRecords getSaleRecordsByOutTradeNo(String outTradeNo);

    /**
     * 根据cn查询订单信息
     * @param saleRecords
     * @return
     */
    SaleRecords getOrderByCn(SaleRecords saleRecords);

    /**
     * 获取全部订单
     * @return
     */
    List<SaleRecords> getAllOrder();

    /**
     * 批量更新订单
     * @param updateList
     */
    void updateBatch(List<SaleRecords> updateList, int type);
}
